﻿<%@ Page Language="C#" %>
<%@ Register TagPrefix="aspxform" Namespace="XFormDesigner.Framework.Web.UI" Assembly="XFormDesigner.Framework" %>
<%@ Register TagPrefix="XTransfarControl" Namespace="BPM.Transfar.XUserControls" Assembly="BPM.Transfar.XUserControls" %>
<script runat="server">

    // Insert page code here
    //

</script>
<!DOCTYPE html>
<html xmlns:XForm="xmlns:xform">

<head runat="server">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <meta name="viewport" content="width=device-width, initial-scalse=1, maximum-scale=1" />
    <title>BPM Form</title>
    <link rel="stylesheet" href="../../style/layui/theme/iconfont/iconfont.css" />
    <link rel="stylesheet" href="../../style/layui/theme/css/global.css" />
    <script type="text/javascript">

        //字符串连接方法
        function stringJoin(splitChar, param1) {
            var result = '';
            if (arguments.length == 1) {
                result = arguments[0];
            }
            if (arguments.length == 2) {
                result = arguments[1];
            }
            if (arguments.length > 2) {
                var schar = splitChar || '';
                var arr = new Array();
                for (var i = 1; i < arguments.length; i++) {
                    if (arguments[i] && typeof (arguments[i]) != "object") {
                        if(typeof (arguments[i]) == "string")
                            arr.push(arguments[i].trim());
                        else arr.push(arguments[i]);
                    }
                }
                result = arr.join(schar);
            }
            return result;
        }


        //字符串格式化方法
        function stringFormat () {
            var result = '';
            if (arguments.length > 0) {
                result = arguments[0];
            }
            if (arguments.length > 1) {
                if (arguments.length == 2 && typeof (arguments[1]) == "object") {
                    var args = arguments[1];
                    for (var key in args) {
                        if (args[key] != undefined) {
                            var reg = new RegExp("({" + key + "})", "g");
                            result = result.replace(reg, args[key]);
                        }
                    }
                }
                else {
					var allIsNull = true;
                    for (var i = 1; i < arguments.length; i++) {
                        if (arguments[i] != undefined  && typeof (arguments[i]) != "object") {
							if(arguments[i] !== undefined && arguments[i] !== '' && arguments[i] !== null) allIsNull = false;
                            //var reg = new RegExp("({[" + (i - 1) + "]})", "g");//这个在索引大于9时会有问题，谢谢何以笙箫的指出
                            var reg = new RegExp("({)" + (i - 1) + "(})", "g");
                            result = result.replace(reg, arguments[i]);
                        }
                    }
					if(allIsNull) result = '';
                }
            }
            return result;
        }


        function stringSub(fullname, acc) {
            var acclength = acc.length + 1;
            if (fullname != "") {
                fullname = fullname.substring(8)
                fullname = fullname.substring(0, fullname.length - acclength);
            }
            return fullname;
        }

        // 数字转换成大写金额函数
        function atoc(numberValue) {
            var numberValue = new String(Math.round(numberValue * 100)); // 数字金额
            var chineseValue = ""; // 转换后的汉字金额
            var String1 = "零壹贰叁肆伍陆柒捌玖"; // 汉字数字
            var String2 = "万仟佰拾亿仟佰拾万仟佰拾元角分"; // 对应单位
            var len = numberValue.length; // numberValue 的字符串长度
            var Ch1; // 数字的汉语读法
            var Ch2; // 数字位的汉字读法
            var nZero = 0; // 用来计算连续的零值的个数
            var String3; // 指定位置的数值
            if (len > 15) {
                alert("超出计算范围");
                return "";
            }
            if (numberValue == 0) {
                chineseValue = "零元整";
                return chineseValue;
            }
            String2 = String2.substr(String2.length - len, len); // 取出对应位数的STRING2的值
            for (var i = 0; i < len; i++) {
                String3 = parseInt(numberValue.substr(i, 1), 10); // 取出需转换的某一位的值
                if (i != (len - 3) && i != (len - 7) && i != (len - 11) && i != (len - 15)) {
                    if (String3 == 0) {
                        Ch1 = "";
                        Ch2 = "";
                        nZero = nZero + 1;
                    }
                    else if (String3 != 0 && nZero != 0) {
                        Ch1 = "零" + String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else {
                        Ch1 = String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                }
                else { // 该位是万亿，亿，万，元位等关键位
                    if (String3 != 0 && nZero != 0) {
                        Ch1 = "零" + String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else if (String3 != 0 && nZero == 0) {
                        Ch1 = String1.substr(String3, 1);
                        Ch2 = String2.substr(i, 1);
                        nZero = 0;
                    }
                    else if (String3 == 0 && nZero >= 3) {
                        Ch1 = "";
                        Ch2 = "";
                        nZero = nZero + 1;
                    }
                    else {
                        Ch1 = "";
                        Ch2 = String2.substr(i, 1);
                        nZero = nZero + 1;
                    }
                    if (i == (len - 11) || i == (len - 3)) { // 如果该位是亿位或元位，则必须写上
                        Ch2 = String2.substr(i, 1);
                    }
                }
                chineseValue = chineseValue + Ch1 + Ch2;
            }
            if (String3 == 0) { // 最后一位（分）为0时，加上“整”
                chineseValue = chineseValue + "整";
            }
            return chineseValue;
        }

        function DeleteRow() {
            var ev = window.event;
            var el = ev.target || ev.srcElement;
            var vp = { x: ev.pageX, y: ev.pageY };
            var g = YZSoft.forms.field.GridBase.hitTestGrid(vp);
            var bi = -1;
            if (g)
                bi = YZSoft.forms.field.GridBase.hitTestBlock(g, vp.y);

            var bc = g.Blocks.length;
            if ((bc <= 0) || (bc == 1 && g.getEleType().GridDefine.ShowOneBlockAlways)) {
                //if ((bc <= 0) || (bc == 1)) {
                alert("最后一行不允许删除");
                return;
            }
            g.deleteBlocks(bi, 1);
            return false;
        }

    </script>
</head>

<body>
    <form runat="server">
        <!-- Insert content here -->
        <div class="main-tit clearfix">
            <div class="site-l fl">
                <img alt="" src="/YZSoft/forms/style/layui/theme/img/SN_LOGO.png" />
            </div>
            <div class="site-h1">
                {{pageTitle}}
            </div>
            <div class="site-r fr">
                <div class="num">
                    <aspxform:XLabel id="XL_SNText" runat="server" Text="流水号："></aspxform:XLabel>
                    <cite>
                        <aspxform:XLabel id="XL_SN" runat="server" Text="--系统自动生成--" XDataBind="SN_PUB_FLOWCOMMON.FormNumber" Visibility="False" FieldName="流水号"></aspxform:XLabel>
                    </cite>
                </div>
                <div class="date">
                    <aspxform:XLabel id="XL_DateText" runat="server" Text="申请时间："></aspxform:XLabel>
                    <cite>
                        <aspxform:XLabel id="XL_Date" runat="server" XDataBind="SN_PUB_FLOWCOMMON.CreateDate" Visibility="False" FieldName="申请时间"></aspxform:XLabel>
                    </cite>
                </div>
            </div>
        </div>
        <div class="tf-fluid tf-btn-fluid">
            <div class="tf-collapse">
                <div class="tf-colla-title">
                    <span>申请人信息 </span>
                    <div class="tf-colla-icon">
                    </div>
                </div>
                <div class="tf-colla-cont is-show">
                    <div class="tf-row">
                        <div class="tf-col-md4">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel1" runat="server" text="申请人"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTxt_REQUSERNAME_ACCOUNT" runat="server" FieldName="申请人" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False" Express="javascript('stringFormat', '{0}({1})',SN_PUB_FLOWCOMMON.CreateUserName,SN_PUB_FLOWCOMMON.CreateUserAccount)"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                        <div class="tf-col-md4 tf-hidden" hiddenexpress="1">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel2" runat="server" text="申请人账号"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTxt_CreateUserAccountT" runat="server" XDataBind="SN_PUB_FLOWCOMMON.CreateUserAccount" FieldName="申请人账号" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False" HiddenExpress="1"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                        <div class="tf-col-md4 tf-hidden" hiddenexpress="1">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel3" runat="server" text="申请人姓名"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTxt_CreateUserName" runat="server" XDataBind="SN_PUB_FLOWCOMMON.CreateUserName" FieldName="申请人姓名" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False" HiddenExpress="1"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                        <div class="tf-col-md4 tf-hidden" hiddenexpress="1">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel4" runat="server" text="人员全路径"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTxt_CreateUserFullName" runat="server" XDataBind="SN_PUB_FLOWCOMMON.CreateUserFullName" FieldName="人员全路径" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False" HiddenExpress="1"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                        <div class="tf-col-md4">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel5" runat="server" text="部门名称"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTxt_CreateDeptName" runat="server" XDataBind="SN_PUB_FLOWCOMMON.CreateDeptName" FieldName="部门名称" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                        <div class="tf-col-md4">
                            <div class="tf-form-item">
                                <label class="tf-form-label">
                                    <aspxform:XLabel id="XLabel6" runat="server" text="所属部门"></aspxform:XLabel>
                                </label>
                                <div class="tf-input-block">
                                    <aspxform:XTextBox id="XTXT_DeptFull" runat="server" FieldName="所属部门" BorderWidth="1" BorderColor="#DCDCDC" Width="100%" Enabled="False" Express="javascript('stringSub',SN_PUB_FLOWCOMMON.CreateUserFullName,SN_PUB_FLOWCOMMON.CreateUserAccount)"></aspxform:XTextBox>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <hr class="tf-hr tf-bg-gray" />
            <div class="tf-collapse">
                <div class="tf-colla-title" runat="server">
                    <span>基本信息</span>
                    <div class="tf-colla-icon">
                    </div>
                </div>
                <div class="tf-colla-cont is-show">
                    <div class="tf-row">
                        {{formMain}}
                        <!-- 文本框样式-撑满 -->
                    </div>
                </div>
            </div>
            {{content}}
            <div class="tf-collapse">
                <hr class="tf-hr tf-bg-gray" />
                <div class="tf-colla-title">
                    <span>审批历史</span>
                    <div class="tf-colla-icon">
                    </div>
                </div>
                <div class="tf-colla-cont is-show">
                    <XTRANSFARCONTROL:XXSIGNTRACE id="TB_XSignTrace" runat="server" BorderWidth="1" BorderColor="#dcdcdc" Width="100%" CssClass="TB_XSignTrace"></XTRANSFARCONTROL:XXSIGNTRACE>
                </div>
            </div>
        </div>
        <script src="../../style/layui/theme/jquery.min.js"></script>
        <script src="../../style/layui/theme/common.js"></script>
    </form>
</body>
</html>
